﻿
/****** Object:  Table [dbo].[DbObjects]    Script Date: 05/12/2010 11:22:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [DbObjects](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ParentId] [int] NULL,
	[Name] [varchar](250) NOT NULL,
	[Description] [varchar](max) NULL,
	[Deleted] [bit] NOT NULL,
	[DbType] [int] NOT NULL,
 CONSTRAINT [PK_DbObjects] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Comment]    Script Date: 05/12/2010 11:22:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [Comment](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Message] [varchar](max) NULL,
	[DbObjectId] [int] NOT NULL,
	[CreatedBy] [varchar](50)  NOT NULL CONSTRAINT [DF_Comment_CreatedBy] DEFAULT 'Annoymous',
	[CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_Comment_CreatedOn]  DEFAULT (getdate()),
	[ModifiedBy] [varchar](50) NOT NULL CONSTRAINT [DF_Comment_ModifiedBy] DEFAULT 'Annoymous',
	[ModifiedOn] [datetime] NOT NULL CONSTRAINT [DF_Comment_ModifiedOn]  DEFAULT (getdate()),
 CONSTRAINT [PK_Comment] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[CommentLog]    Script Date: 05/12/2010 11:22:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [CommentLog](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ParentId] [int] NOT NULL,
	[Message] [varchar](max) NULL,
	[DbObjectId] [int] NOT NULL,
	[CreatedBy] [varchar](50) NOT NULL CONSTRAINT [DF_CommentLog_CreatedBy] DEFAULT 'Annoymous',
	[CreatedOn] [datetime] NOT NULL CONSTRAINT [DF_CommentLog_CreatedOn]  DEFAULT (getdate()),
	[ModifiedBy] [varchar](50) NOT NULL CONSTRAINT [DF_CommentLog_ModifiedBy] DEFAULT 'Annoymous',
	[ModifiedOn] [datetime] NOT NULL CONSTRAINT [DF_CommentLog_ModifiedOn]  DEFAULT (getdate()),
 CONSTRAINT [PK_CommentLog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO


/****** Object:  Table [AppSettings]   Script Date: 05/12/2010 11:22:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [AppSettings](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Key] [varchar](100) NOT NULL,
	[Value] [varchar](255) NOT NULL,
	[DataType] [varchar](50) NOT NULL
 CONSTRAINT [PK_AppSettings] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO



/****** Object:  Table [AppUser]   Script Date: 05/12/2010 11:22:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [AppUser](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Username] [varchar](100) NOT NULL,
	[Password] [varchar](100) NOT NULL,
	[IsAdmin] [bit] DEFAULT 0
 CONSTRAINT [PK_AppUser] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO

INSERT INTO [AppUser] (Username, [Password], [IsAdmin]) VALUES ('tushar', 'powerdoc', 1)
GO

INSERT INTO [AppSettings] ([Key], [Value], [DataType]) VALUES('RequireLogin', 'true', 'bool')
GO

INSERT INTO [AppSettings] ([Key], [Value], [DataType]) VALUES('IncludeSystemObjects', 'false', 'bool')
GO

INSERT INTO [AppSettings] ([Key], [Value], [DataType]) VALUES('ExcludedDatabases', 'master,temp,tempdb,msdb,model', 'string')
GO